#ifndef TGAIMAGEDECODER_H_
#define TGAIMAGEDECODER_H_

#include "Header.h"
#include "ImageDecoder.h"

#pragma pack(push,x1)
#pragma pack(1)

class TGA_HEADER
{
public:
	unsigned char	IdSize, 
					MapType, 
					ImageType;
	unsigned short	PaletteStart,
					PaletteSize;
	unsigned char	PaletteEntryDepth;
	unsigned short	X,
					Y,
					Width,
					Height;
	unsigned char	ColorDepth,
					Descriptor;

};

class ColorRGB
{
public:
	unsigned char r,b,g;
	ColorRGB(unsigned char _r = 0.0f, unsigned char _g = 0.0f, unsigned char _b = 0.0f)
	{
		r = _r;
		g = _g;
		b = _b;
	};
};

#pragma pack(pop, x1)

#define INVERTED_BIT (1 << 5)

class TGAImageDecoder : public ImageDecoder
{
public:
	void Decode(FILE *fp, Texture2D &image);
};

#endif
